<!--共用distributor_sxqd里的css-->
<ion-view view-title="我的{{title}}" class="distributor_sxqd myagent">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
	</ion-nav-bar>

	<ion-content class="bg" style="bottom: 60px;">
		<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
		
		<!--没有数据firstHide -->
		<div class="noData" ng-if="!datas.store">
			<img src="./img/guilin/other/noorder@2x.png" />
			<div class="tip">你还没有授权数据</div>
			<div class="tipAgin">请赶快添加吧！</div>
		</div>
		
		<div class="list">
			<div class="item item-text-wrap supplierframe" ng-repeat-start="data in datas.store">
				<div class="imgframe">
					<img src="./img/guilin/common/icon_shop@2x.png" />
				</div>
				<div class="shopframe">
					<div class="shopname" on-tap="onshow_first(data.store_id)">
						{{data.store_name}}<img src="./img/guilin/common/icon_right@2x.png"/>
					</div>
					<p>代理品牌：{{data.brands_name}}</p>
					<p>授信额度：{{data.credit_line}}</p>
					<p>欠款金额：{{data.used_amount}}<span class="waitConfirm" ng-if="data.confirm_amount">待确认：{{data.confirm_amount}}</span></p>
				</div>
			</div>
			<ion-scroll direction="x" scrollbar-x="false" ng-repeat-end="" delegate-handle="btnScroll">
				<div class="item btnItem" style="width: {{83*data.buttons.length+10}}px;">					
					<div class="basebtn" style="border-color:{{button.color}};color:{{button.color}};" ng-repeat="button in data.buttons" on-tap="switchEvent(button.id,data.store_id)">
						<span class="redPot" ng-if="button.id==2&&data.confirm_amount"></span><!--授信还款按钮显示红点-->
						<img src="./img/guilin/other/red-bag.icon@2x.png" ng-if="button.id==4"/>{{button.name}}
					</div>
				</div>
			</ion-scroll>
		</div>
		<ion-infinite-scroll ng-if="!isLoad&&datas.page.tPage>datas.page.cPage" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
	</ion-content>
	
	<div class="addBtn" on-tap="onshow_add()">添加{{title}}</div>
</ion-view>